package com.wnhz.work.yz.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.wnhz.work.yz.BaseActivity;
import com.wnhz.work.yz.MyApplication;
import com.wnhz.work.yz.R;
import com.wnhz.work.yz.base.BaseRVAdapter;
import com.wnhz.work.yz.base.BaseViewHolder;

public class OutListActivity extends BaseActivity implements View.OnClickListener {
    private RecyclerView recycler;
    private String budget_id = "";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_out_list);
        TextView title = (TextView) findViewById(R.id.view_main_middle_title);
        title.setText("装车清单");
        budget_id = getIntent().getStringExtra("budget_id");
        findViewById(R.id.btn_main_left).setOnClickListener(this);
        recycler = (RecyclerView) findViewById(R.id.recycler);
        recycler.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
        recycler.setAdapter(new BaseRVAdapter(this, MyApplication.test) {
            @Override
            public int getLayoutId(int viewType) {
                return R.layout.item_outlist2;
            }

            @Override
            public void onBind(BaseViewHolder holder, int position) {
                RecyclerView recycler = holder.getView(R.id.recycler);
                recycler.setLayoutManager(new LinearLayoutManager(OutListActivity.this, LinearLayoutManager.VERTICAL, false));
                recycler.setAdapter(new BaseRVAdapter(OutListActivity.this, MyApplication.test) {
                    @Override
                    public int getLayoutId(int viewType) {
                        return R.layout.item_outshop;
                    }

                    @Override
                    public void onBind(BaseViewHolder holder, int position) {

                    }
                });
            }

        });
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_main_left:
                finish();
                break;
        }
    }
}
